const app = getApp()

Page({
  data: {
    
    tihuoWay: '佛山',
    url: app.getUrl.Urlcom,
    toView: 'inToView1', 

  },

  scrollToViewFn: function (e) {
    var _id = e.target.dataset.id;
    this.setData({
      toView: 'inToView' + _id
    })
    console.log(this.data.toView)
  },


  /**
* 生命周期函数--监听页面加载
*/
  onLoad: function () {
    app.editTabBar();    //显示自定义的底部导航  
    this.home_class();//查询品牌
    this.home_class1();//查询全部品牌

  },
  


  //查询品牌分类
  home_class: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/Index/home_class.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        // console.info(res.data)
        that.setData({
          classname: res.data
        })
      },
    })
  },
  

  //查询全部品牌分类
  home_class1: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/Selection/home_class.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        // console.info(res.data);
        that.setData({
          classname1: res.data
        })
      },
    })

  },





})
